
    function getUserInformation() {
    $.ajax({
        url:"/system/information/getUserInformation",
        type:"get",
        data:{
        },
        success:function(data){
            var str="";
            for (i in data) {
                //console.log("i="+i);
                var time = data[i].createDate;
                str += '<a class="dropdown-item d-flex align-items-center" href="/system/information/myInfo">\n' +
                    '<div class="mr-3">\n' +
                    '<div class="icon-circle bg-primary">\n' +
                    '<i class="fas fa-file-alt text-white"></i>\n' +
                    '</div>\n' +
                    '</div>\n' +
                    '<div>\n' +
                    '<div class="small text-primary">' +data[i].title +'</div>\n' +
                    '<div class="font-weight-bold text-info">' + data[i].content + '</div>\n' +
                    '<div class="small text-dark text-right">' +timeFmt(time).toString() + '</div>\n' +
                    '</div>\n' +
                    '</a>\n';
            }
            //console.log(str);
            $("#info_s").html(str);
        }
    })
}

    (function (){
    getUserInformation();
        getInfoNumber();
    //console.log("调用了");
}());
//获得该用户总共有多少个信息，并且显示在小铃铛右上角红色气泡内
function getInfoNumber(){
    $.ajax({
        url:"/system/information/getInfoNumber",
        type:"get",
        data:{
        },
        success:function(data){
            if(data!=null || !isNaN(data))
                $("#InfoNumber").text(data);
            else
                $("#InfoNumber").text("");
        }
    })
}

    //时间格式化
    function timeFmt(value) {
    var date=new Date(value);
    var year=date.getFullYear();
    var month=date.getMonth()+1;
    month=month>9?month:('0'+month);
    var day=date.getDate();
    day=day>9?day:('0'+day);
    var hh=date.getHours();
    hh=hh>9?hh:('0'+hh);
    var mm=date.getMinutes();
    mm=mm>9?mm:('0'+mm);
    var ss=date.getSeconds();
    ss=ss>9?ss:('0'+ss);
    var time=year+'-'+month+'-'+day+' '+hh+':'+mm+':'+ss;
    return time;
};
